Hi,
I am filtering my module as per some certain data which one attribute holds. I want to output this filtered data into csv format. I can do the DOORS export to csv process manually but there are 70 modules and this activity may have to be done multiple times.
To make work simpler and faster I wrote this script which I will modify later to run at folder level.
The problem I am having now is that the 'Object Text' of the requirements is spread across multiple lines with many new line characters. When I see the csv that I get at the end of the script execution, each new line of the 'Object Text' has come in a new cell and the exported data is completely useless. Is there any way to get all the object text into a single cell?
I tried analysing the 'export to csv' DXL that is present in DOORS but I got lost somewhere trying to understand how it works.
Module mod = current
Stream out = write "seeme.csv"
Filter f1
int accepted = 0
int rejected = 0
f1 = contains(attribute "Req", "Accept", false)
set(mod, f1, accepted, rejected)
filtering (true)
for obj in mod do
{
out << identifier obj "\t"
out << "\"" obj."Object Text" "\""
out << "\n"
}
close out
Any help will be gratefully received :-)
Thanks,
Nayak
jnbharadhwaj - Mon Sep 24 04:11:22 EDT 2012 |
|
Re: Export multi-line Object text adevicq - Mon Sep 24 04:16:24 EDT 2012
Hi,
Why don't you export everything in Excel and filter in Excel?
Regards,
Alain
|
|
Re: Export multi-line Object text jnbharadhwaj - Mon Sep 24 04:20:55 EDT 2012
Hi Alain,
I will be needing to filter as per links as well as the object data. I don't think that the links data will be present in the excel for filtering.
-
Nayak
|
|
Re: Export multi-line Object text SystemAdmin - Mon Sep 24 04:42:57 EDT 2012
It is possible that your object text contains " and/or Tab-characters. In this case, surrounding the object text by "" is not enough, you also need to escape the contained '"', ',', '(tab)' characteres.
Have a look at https://www.ibm.com/developerworks/forums/thread.jspa?threadID=373788&tstart=0 for a way to create CSV files.
Regards,
Mike
|
|
Re: Export multi-line Object text adevicq - Mon Sep 24 05:37:55 EDT 2012 jnbharadhwaj - Mon Sep 24 04:20:55 EDT 2012
Hi Alain,
I will be needing to filter as per links as well as the object data. I don't think that the links data will be present in the excel for filtering.
-
Nayak
You could create a DXL column to compute an indicator that you will une afterwards in Excel.
Alain
|
|
Re: Export multi-line Object text Bob_Swan - Fri Sep 28 03:22:49 EDT 2012 adevicq - Mon Sep 24 04:16:24 EDT 2012
Hi,
Why don't you export everything in Excel and filter in Excel?
Regards,
Alain
One snag I ran into exporting 'single object with large amounts of data/multiple lines' is that excel has limits on the amount of data it will display in a single cell.
All the data was present, just not viewable (except by selecting the cell which then shows the contents in the edit box at top of page).
Needed some VBA code to detect 'overfull cell', then split the text into new cells.
As a sidenote export to HTML lets you view all the cells contents, but is a pig to modify for printing.
|
|